package cn.edu.gdpt.mobile0123456789hwh0526;

import android.os.Bundle;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    private Button btnMainInsert;
    private RecyclerView rvMaintUsers;
    private List<Users> usersList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        usersList=new MyDataAdapter().QueryAll(this);
        rvMaintUsers.setAdapter(new UsersRViewAdapter(usersList));
    }

    private void initView() {
        btnMainInsert = (Button) findViewById(R.id.btnMainInsert);
        rvMaintUsers = (RecyclerView) findViewById(R.id.rvMaintUsers);
        rvMaintUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}